class Solution(object):
    def isAnagram(self, s, t):
        """
        :type s: str
        :type t: str
        :rtype: bool
        """
        if len(s) != len(t): return False
        HashTable_s = {}
        for i in s:
            if i in HashTable_s: HashTable_s[i] += 1
            else: HashTable_s[i] = 1

        HashTable_t = {}
        for i in t:
            if i in HashTable_t: HashTable_t[i] += 1
            else: HashTable_t[i] = 1
        return HashTable_t==HashTable_s
a = Solution()
# str_a = "anagram"
# str_b = "nagaram"
str_a = "abc"
str_b = "bca"
print a.isAnagram(str_a,str_b)
